import { lazy } from "react";
import { Navigate } from "react-router-dom";
import OrderRouter from './OrderRouter.jsx';
import GoodsRouter from './GoodsRouter.jsx';
import PurchaseRouter from './PurchaseRouter.jsx';
import InventoryRouter from './InventoryRouter.jsx';
import StorageRouter from './StorageRouter.jsx';
import AccountRouter from './AccountRouter.jsx';
import BasicRouter from './BasicRouter.jsx';

const MainRouter = [
	{
		path: "/",
		Component: lazy(() => import("@/layouts/AuthLayout.jsx")),
		children: [
			{
				path: "/home",
				icon: "home",
				name: "首页",
				Component: lazy(() => import("@/pages/Home/index"))
			},
      ...OrderRouter,
      ...GoodsRouter,
      ...PurchaseRouter,
      ...StorageRouter,
      ...InventoryRouter,
      ...AccountRouter,
      ...BasicRouter
		]
	},
	{
		path: "/",
		element: <Navigate to="/home" />
	},
	{
		path: "*",
		element: <Navigate to="/home" />
	}
];

export default MainRouter;
